<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编程之友BBS-板块页</title>
<link rel="stylesheet" type="text/css" href="style/top.css"/>
<link rel="stylesheet" type="text/css" href="style/main.css"/>
<link rel="stylesheet" type="text/css" href="style/footer.css"/>

</head>

<body>
	<c:if test="${not empty sessionScope.bemsg }">
		<div class="toperror">
			<h1>${sessionScope.bemsg }</h1>
		</div>
	</c:if>
	<c:remove var="bemsg" scope="session" />
	<!-- head开始 -->
	<%@ include file="template/head.jsp" %>
	<!-- head结束 -->
    <div style="margin-top: 10px">
    </div>

	<div id="wp" class="wp">
    
    	<!-- 导航开始 -->
    	<div id="pt" class="bm cl">
            <div id="ct" class="ct2_a wp cl">
                <div class="z">
                    <a class="nvhm" title="首页" href="index.jspx">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
                    <em>›</em>
                 	${blocks.name }
                </div>
            </div>
       	</div>
       	<!-- 导航结束 -->
       	
        <!-- 主体部分开始 -->
        	<div id="ct" class="wp cl">
            	<div class="mn">
                	<!-- 板块介绍开始 -->
                	<div class="bm bml bmw">
                    	<div class="bm_h cl">
                        	<h1 class="xs2">
                            	<a href="blocks.jspx?_method=show&&id=${sessionScope.blocks.id }">${sessionScope.blocks.name }</a>
                            </h1>
                        </div>
                        <div class="bm_c cl">
                        	<div class="pbn">
                            	版主：
                            	<c:choose>
                            		<c:when test="${not empty sessionScope.listM }">
                            			<c:forEach items="${sessionScope.listM }" var="moderator">
                            				<a style="color: blue;" href="#">${moderator.user.username }</a>
                            			</c:forEach>
                            		</c:when>
                            		<c:otherwise>
                            			暂无
                            		</c:otherwise>
                            	</c:choose>
                            </div>
                            <div id="forum_rules_323" style="">
                            	<div class="pbm xg2">
                                	<p align="center">
                                	        这个是版规！<br/>
						                                        这个是版规！<br/>
						                                        这个是版规！<br/>
						                                        这个是版规！<br/>
						                                        这个是版规！<br/>
						                                        这个是版规！
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 板块介绍结束 -->
                    
                    <!-- 发帖回帖开始 -->
                    <div id="pgt" class="pgs mbm cl">
                        <div class="pg">
                        	<c:if test="${sessionScope.page.currentPage gt 7 and sessionScope.page.totlePages gt 10}">
                        		<a href="blocks.jspx?_method=show&id=${sessionScope.blocks.id }&page=1">1..</a>
                        	</c:if>
                 			<c:forEach items="${sessionScope.page.slider }" var="x">
                 				<c:choose>
	                 				<c:when test="${sessionScope.page.currentPage eq x }">
	                 					<strong>${x }</strong>
	                 				</c:when>
	                 				<c:otherwise>
	                 					<a href="blocks.jspx?_method=show&id=${sessionScope.blocks.id }&page=${x }">${x }</a>
	                 				</c:otherwise>
                 				</c:choose>
                 			</c:forEach>
                 			<c:if test="${sessionScope.page.currentPage+4 lt sessionScope.page.totlePages and sessionScope.page.totlePages gt 10}">
                 				<a href="blocks.jspx?_method=show&id=${sessionScope.blocks.id }&page=${sessionScope.page.totlePages }">..${sessionScope.page.totlePages }</a>
                 			</c:if>
                 			<c:if test="${not sessionScope.page.last }">
                 				<a class="nxt" href="blocks.jspx?_method=show&id=${sessionScope.blocks.id }&page=${sessionScope.page.currentPage+1 }">下一页</a> 
                 			</c:if>
                        </div>
                        <span class="pgb y">
                        	<a href="index.jspx">返回</a>
                        </span>
                        <a id="newspecial" title="发新帖" href="index.jspx?_method=create&id=${sessionScope.blocks.id }" >
                            <img alt="发新帖" src="images/pn_post.png" />
                        </a>
                    </div>
                	<!-- 发帖回帖结束 -->
                    
                    <div class="clear"></div>
                    <div style="margin: 10px;"></div>
                    
                    <!-- 帖子列表开始 -->
                    <div id="threadlist" class="tl bm bmw">
                    	<h1 class="xs2 sub_bg" style="padding-left: 20px;">
                        	<a href="blocks.jspx?_method=show&&id=${sessionScope.blocks.id }" style="color: #FFF">${sessionScope.blocks.name }</a>
                        </h1> 
                        
                        <div class="bm_c">
                        	<table cellpadding="0" cellspacing="0" style="width: 978px;">
                        		<c:forEach items="${sessionScope.blocks.alist }" var="article">
                            	<tbody>
                                	<tr>
                                    	<td class="icn">
                                        	
                                        		<c:choose>
                                        			<c:when test="${article.type eq 1 }">
                                        				<a target="_blank" title="帖子" href="article.jspx?_method=show&id=${article.id }">
                                            				<img alt="帖子" src="images/folder_new.gif"  />
                                            			</a>
                                            		</c:when>
                                            		<c:otherwise>
                                            			<a target="_blank" title="置顶帖" href="article.jspx?_method=show&id=${article.id }">
                                            				<img alt="置顶帖" src="images/pin_1.gif"  />
                                            			</a>
                                            		</c:otherwise>
                                            	</c:choose>
                                           
                                        </td>
                                        <th class="new">
                                        	<a class="xst" href="article.jspx?_method=show&id=${article.id }">${article.name }</a>
                                        </th>
                                        <td class="by">
                                        	<cite>
                                            	<a href="#">${article.user.username }</a>
                                            </cite><br/>
                                            <em>${article.createdate }</em>
                                        </td>
                                        <td class="num">
                                        	<a class="xi2" href="#">${article.replyNum }回</a><br/>
                                            <em>${article.clickNum }阅</em>
                                        </td>
                                        <td class="by">
                                        	<c:if test="${sessionScope.user.role eq '2' }">
                                        		<a class="red" href="article.jspx?_method=collection&id=${article.id }">收藏</a>
                                        		<span class="pipe" style="margin: 0 5px;"> | </span>
                                        		<a class="red" href="article.jspx?_method=settop&id=${article.id }&userid=${sessionScope.user.id}&bid=${sessionScope.blocks.id}">置顶</a>
                                        		<span class="pipe" style="margin: 0 5px;"> | </span>
                                        		<a class="red" href="article.jspx?_method=delete&id=${article.id }&userid=${sessionScope.user.id}&bid=${sessionScope.blocks.id}">删除</a>
                                        	</c:if>
                                        	<c:if test="${sessionScope.user.role eq '1' }">
                                        		<a class="red" href="article.jspx?_method=collection&id=${article.id }">收藏</a>
                                        	</c:if>
                                        </td>
                                    </tr>
                                </tbody>
                                </c:forEach>
                            </table>
                        </div>
                    </div>
                    
                    <!-- 帖子列表结束 -->
                    
                </div>
        	</div>
        <!-- 主体部分结束 -->
        
    </div>
	
	<!-- footer开始 -->
	<%@ include file="template/footer.jsp" %>
    <!-- footer结束 -->
    
</body>

</html>
